import QtQuick
import QtQml

import "qrc:/usv_bridge/UI/"

Rectangle {
    id: top_menu
    width: parent.width
    height: 48

    color:"#FCFCFC"

    Timer {
        interval: 500; running: true; repeat: true
        onTriggered: function(){
            text_time.text = qsTr(new Date().toLocaleString(Qt.locale("zh_CN"), "h:mm:ss AP"));
            text_date.text = qsTr(new Date().toLocaleString(Qt.locale("zh_CN"), "M/d/yy"))
        }
    }

    Row{
        id: left_text_row
        spacing: 10
        anchors{
            left: parent.left
            leftMargin: 20
            verticalCenter: parent.verticalCenter
        }
        //IMAGE
        Image {
            id: icon
            source: "qrc:/usv_bridge/UI/Icon.png"
            anchors{
                verticalCenter: parent.verticalCenter
            }
        }

        Text {
            id: text_conning
            text: qsTr("指挥驾驶")
            font.family: "Noto Sans"
            font.pixelSize: 16
            color: "#1A1A1A"
            anchors{
                verticalCenter: parent.verticalCenter
            }
        }
        Text {
            id: text_page
            text: qsTr("主页面")
            font.family: ("Noto Sans")
            font.pixelSize: 16
            color: "#1A1A1A"
            font.bold: true
            anchors{
                verticalCenter: parent.verticalCenter
            }
        }
    }

    Row{
        id: right_text_row
        spacing: 10
        anchors{
            right: parent.right
            rightMargin: 20
            verticalCenter: parent.verticalCenter
        }
        //2个text
        //Time
        Text {
            id: text_time
            text: qsTr(new Date().toLocaleString(Qt.locale("zh_CN"), "h:mm:ss AP"))
            font.family: ("Noto Sans")
            font.pixelSize: 16
            color: "#1A1A1A"
            anchors{
                verticalCenter: parent.verticalCenter
            }
        }
        // Date
        Text {
            id: text_date
            text: qsTr(new Date().toLocaleString(Qt.locale("zh_CN"), "M/d/yy"))
            font.family: ("Noto Sans")
            font.pixelSize: 16
            color: "#1A1A1A"
            anchors{
                verticalCenter: parent.verticalCenter
            }
        }

        //4个icon
        Image{
            anchors{
                verticalCenter: parent.verticalCenter
            }
            source: "qrc:/usv_bridge/UI/right_icon_1.png"
        }

        Image{
            anchors{
                verticalCenter: parent.verticalCenter
            }
            source: "qrc:/usv_bridge/UI/right_icon_2.png"
        }

        Image{
            source: "qrc:/usv_bridge/UI/right_icon_3.png"
        }

        Image{
            anchors{
                verticalCenter: parent.verticalCenter
            }
            source: "qrc:/usv_bridge/UI/right_icon_4.png"
        }
    }

}
